<template>
  <van-popup
    v-model="attachPopUp"
    position="bottom"
    :style="{ height: '60%' }"
    closeable
    get-container="body"
  >
    <div class="px-1" style="padding-top: 50px">
      <el-table :data="attachList">
        <el-table-column label="序号" width="80" align="center" type="index" />
        <el-table-column
          align="center"
          label="附件名称"
          :prop="fileNameKey"
        />
        <el-table-column
          align="center"
          prop="duties"
          width="80"
          label="操作"
        >
          <template slot-scope="{ row }">
            <el-link
              type="primary"
              @click="handleDownLoad(row[fileUrlKey] || row.fileAttachUuid )"
            >下载</el-link>
          </template>
        </el-table-column>
        <el-empty slot="empty" description="暂无附件" />
      </el-table>
    </div>
  </van-popup>
</template>

<script>
import commonList from '@/assets/mixin/commonList'
export default {
  mixins: [commonList],
  props: {
    fileNameKey: {
      default: 'fileName',
      type: String
    },
    fileUrlKey: {
      default: 'fileUrl',
      type: String
    }
  },
  data() {
    return {
      attachPopUp: false,
      attachList: []
    }
  }
}
</script>

<style></style>
